package org.com.behavioralPattern.statePattern;

/**
 * @author Jonny
 * @version 1.0
 * @Description:
 * @date 2021/4/28 10:03
 */
public class TV {
    private final static Channel cctv1=new CCTV1();
    private final static Channel cctv2=new CCTV2();
    private final static Channel cctv3=new CCTV3();
    private Channel channel;
    public void setChannel(Channel channel){
        this.channel=channel;
    }

    public void disCCTV1(){
        this.setChannel(cctv1);
        this.channel.display();
    }

    public void disCCTV2(){
        this.setChannel(cctv2);
        this.channel.display();
    }

    public void disCCTV3(){
        this.setChannel(cctv3);
        this.channel.display();
    }
}
